{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# EqualWidthDiscretiser + OrdinalEncoder\n",
    "\n",
    "\n",
    "This is very useful for linear models, because by using discretisation + a monotonic encoding, we create monotonic variables with the target, from those that before were not originally. And this tends to help improve the performance of the linear model. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## EqualWidthDiscretiser\n",
    "\n",
    "The EqualWidthDiscretiser() divides continuous numerical variables into\n",
    "intervals of the same width, that is, equidistant intervals. Note that the\n",
    "proportion of observations per interval may vary.\n",
    "\n",
    "The number of intervals\n",
    "in which the variable should be divided must be indicated by the user.\n",
    "\n",
    "<b>Note:</b> Check out the EqualWidthDiscretiser notebook to learn more about this transformer."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## OrdinalEncoder\n",
    "The OrdinalEncoder() will replace the variable labels by digits, from 1 to the number of different labels. \n",
    "\n",
    "If we select \"arbitrary\", then the encoder will assign numbers as the labels appear in the variable (first come first served).\n",
    "\n",
    "If we select \"ordered\", the encoder will assign numbers following the mean of the target value for that label. So labels for which the mean of the target is higher will get the number 1, and those where the mean of the target is smallest will get the number n.\n",
    "\n",
    "<b>Note:</b> Check out the OrdinalEncoder notebook to know more about this transformer."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.pipeline import Pipeline\n",
    "\n",
    "\n",
    "from feature_engine.discretisation import EqualWidthDiscretiser\n",
    "from feature_engine.encoding import OrdinalEncoder\n",
    "\n",
    "plt.rcParams[\"figure.figsize\"] = [15,5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Load titanic dataset from OpenML\n",
    "\n",
    "def load_titanic():\n",
    "    data = pd.read_csv('https://www.openml.org/data/get_csv/16826755/phpMYEkMl')\n",
    "    data = data.replace('?', np.nan)\n",
    "    data['cabin'] = data['cabin'].astype(str).str[0]\n",
    "    data['pclass'] = data['pclass'].astype('O')\n",
    "    data['age'] = data['age'].astype('float').fillna(data.age.median())\n",
    "    data['fare'] = data['fare'].astype('float').fillna(data.fare.median())\n",
    "    data['embarked'].fillna('C', inplace=True)\n",
    "    data.drop(labels=['boat', 'body', 'home.dest', 'name', 'ticket'], axis=1, inplace=True)\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pclass</th>\n",
       "      <th>survived</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>cabin</th>\n",
       "      <th>embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>29.0000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>211.3375</td>\n",
       "      <td>B</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>male</td>\n",
       "      <td>0.9167</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>female</td>\n",
       "      <td>2.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>male</td>\n",
       "      <td>30.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>female</td>\n",
       "      <td>25.0000</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  pclass  survived     sex      age  sibsp  parch      fare cabin embarked\n",
       "0      1         1  female  29.0000      0      0  211.3375     B        S\n",
       "1      1         1    male   0.9167      1      2  151.5500     C        S\n",
       "2      1         0  female   2.0000      1      2  151.5500     C        S\n",
       "3      1         0    male  30.0000      1      2  151.5500     C        S\n",
       "4      1         0  female  25.0000      1      2  151.5500     C        S"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = load_titanic()\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X_train : (916, 8)\n",
      "X_test : (393, 8)\n"
     ]
    }
   ],
   "source": [
    "# let's separate into training and testing set\n",
    "X = data.drop(['survived'], axis=1)\n",
    "y = data.survived\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(\n",
    "    X, y, test_size=0.3, random_state=0)\n",
    "\n",
    "print(\"X_train :\", X_train.shape)\n",
    "print(\"X_test :\", X_test.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA20AAAE/CAYAAADVKysfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3df7Bc913e8fcTORjjBGLj+I4qaSKXakLsuLHpHZFOWriJ01iJGWQ6445SQ+Riqv5witPRDMgwQ6CtZtw/TGECBkSSRjMxMWrAtSZOIR4ltymdEMdOHGzZca3EwlakWpAfODelpjKf/nGPYFGurPtzz3d3368Zze5+7zm7z/n6Smcfn7NnU1VIkiRJktr0kr4DSJIkSZLOztImSZIkSQ2ztEmSJElSwyxtkiRJktQwS5skSZIkNczSJkmSJEkNs7RJkiSpCUleneRzSb6R5Cf7ziO14ry+A0iSJEmdnwJmq+rqvoNILfFImyRJklrxKuDwUldK4oEIjTVLm7QMSfYk+WJ3+sZjSX6kG1+X5I4kf5rkqSTvTFKndyZJvivJ+5KcSPLlJP8hybp+t0aSpP4l+TjwRuBXkswlubU7VfK5JM8k+fmBZTd3+9ebkzwNfLwb//Ekjyf5WpLfT/KqfrZGWl2WNml5vgj8Q+C7gF8APphkPfDPgbcCVwHfB1x/xnr7gVPA3wGuBt4C/MSQMkuS1KyqehPwP4B3VtXLgM8D7wBeAVwH/KskZ+5XfxB4DXBt97OfAf4x8MruuT40pPjSmkpV9Z1BGnlJHgbeDdwK/HZV/UY3/mbgfuClwHcDTwOvqKo/737+dmBXVb2xl+CSJDUkySzwwap67wI/+yWgqurfJtkMPAV8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VzG8AfjjJUeZPOXpTkg/Sbt6/UlXHu9uTzH/Waivt5j4GHOv+bynAh5kvca3mHfRW4LNV9Wz3eBQya7yM8j52NZzt79xYzssS9/tjOQenLfJ9xLjNwVLfl4zb9gNLfo8z1DkY9dL2GWBLksu6/yu9AzjYc6bFOgjs7O7vBO7tMcvfkCTMfwbo8ar6xYEftZz5lUle0d2/AHgz8AUazVxVt1XVxqrazPzv7cer6kdpNO9pSS5M8vLT94G3AI/SaO6q+t/AM0le3Q1dAzxGo3nP8Hb++tRIGI3MGi+jvI9dDWf7O3cQ2JHk/CSXAVuAB3rIt2qWsd8fxzlY6vuIsZqDZbwvGavth2W9xxnuHFTVSP8B3gb8L+CLwM/2necsGT8EnAD+H/Ot/Gbgu5m/As2T3e3FfeccyPsPmD+8+0fAw92ftzWe+e8Cn+syPwr8XDfebOaB7DPAR0YhL/OfEft89+fw6b9zLedm/ipgD3a/G/8VuKjlvF3m7wC+AnzXwFjTmf0znn9GYR+7Stu5pP008LPdnDwBvLXv/Kuw/Uve7/y3fO4AAABoSURBVI/hHCz5fcS4zcHAdi3qfcm4bf9y3uMMcw7SvaAkSZIkqUGjfnqkJEmSJI01S5skSZIkNczSJkmSJEkNs7RJkiRJUsMsbZIkSZLUMEubJEmSJDXM0iZJkiRJDbO0SZIkSVLD/j+UgSC64ypSUwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1080x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# we will use two continuous variables for the transformations\n",
    "\n",
    "X_train[[\"age\", 'fare']].hist(bins=30)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('EqualWidthDiscretiser',\n",
       "                 EqualWidthDiscretiser(bins=5, return_boundaries=False,\n",
       "                                       return_object=True,\n",
       "                                       variables=['age', 'fare'])),\n",
       "                ('OrdinalEncoder',\n",
       "                 OrdinalEncoder(encoding_method='ordered',\n",
       "                                variables=['age', 'fare']))],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# set up the discretiser\n",
    "ewd = EqualWidthDiscretiser(\n",
    "    bins=5,\n",
    "    variables=['age', 'fare'],\n",
    "    # important: return values as categorical\n",
    "    return_object=True)\n",
    "\n",
    "# set up the encoder\n",
    "oe = OrdinalEncoder(variables=['age', 'fare'])\n",
    "\n",
    "# pipeline\n",
    "transformer = Pipeline(steps=[('EqualWidthDiscretiser', ewd),\n",
    "                              ('OrdinalEncoder', oe),\n",
    "                              ])\n",
    "\n",
    "transformer.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'age': [-inf,\n",
       "  14.933359999999999,\n",
       "  29.700019999999995,\n",
       "  44.46667999999999,\n",
       "  59.23333999999999,\n",
       "  inf],\n",
       " 'fare': [-inf, 102.46584, 204.93168, 307.39752, 409.86336, inf]}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "transformer.named_steps['EqualWidthDiscretiser'].binner_dict_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'age': {4: 0, 1: 1, 2: 2, 3: 3, 0: 4}, 'fare': {0: 0, 2: 1, 1: 2, 4: 3}}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "transformer.named_steps['OrdinalEncoder'].encoder_dict_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>cabin</th>\n",
       "      <th>embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1139</th>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>533</th>\n",
       "      <td>2</td>\n",
       "      <td>female</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>459</th>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1150</th>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>393</th>\n",
       "      <td>2</td>\n",
       "      <td>male</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>n</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     pclass     sex  age  sibsp  parch  fare cabin embarked\n",
       "1139      3    male    2      0      0     0     n        S\n",
       "533       2  female    1      0      1     0     n        S\n",
       "459       2    male    2      1      0     0     n        S\n",
       "1150      3    male    1      0      0     0     n        S\n",
       "393       2    male    1      0      0     0     n        S"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_t = transformer.transform(X_train)\n",
    "test_t = transformer.transform(X_test)\n",
    "\n",
    "test_t.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbkAAAFNCAYAAACdVxEnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3dd5hU9dn/8ffN0rv0uvTecQXBEmtEDKKiBiyJlegTLEHRYBLF8og91oQYY3yMCtJUVBQr2JW2u3RZ+tJ7L1vu3x8z5DeuW4YyO7NnP6/r2uuaM+d7ztxnzux85nvmzPeYuyMiIhJEZeJdgIiISKwo5EREJLAUciIiElgKORERCSyFnIiIBJZCTkREAkshJ0fNzKab2Q1HuWyyme0xs6TjXVfEY4wys9cKmb/AzM44ynW7mbU+6uISnJldbGZrwvuoR7zrORJB3zdyZBRypZyZrTSz/eE3sw1m9oqZVY3R45xzeNrdV7t7VXfPOd6PFS137+Tu04v7cUvIm/ATwLDwPpob72KOl2P5YBaExy+NFHICMMDdqwLdgR7AyDjXI/HXDFhwNAuaWdnjXEvCCPK2BZVCTv7L3TcA0wiFHQBmdrKZfWNm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QqcAlwNzAt/dwNwD5AMgdy30WxvUPZtQ+D/zCyJUFCPd/f3iuO9WCOeiIhIYAX9cKWIiJRiCjkREQkshZyIiASWQk5ERAJLISciIoGlkBNJUGZ2a3iE+tfjXYtISaWfEIgkKDNbDJzv7iuiaFvW3bOLoSyREiXQPwYXKanMbAyhyyZNMbPXCI3QXonQD4KvdfclZnYNcAFQEahiZgOA54AuhP63R7n7O/GoXyRRqCcnkqDMbCWQAhwC9oVHtTkHuNndB4VD7iGgq7tvM7OHgYXu/lp4CKUfgB7uvjdOmyASd+rJiSS+GoSGRGpDaFT2chHzPnb3w9ea+yVwoZndGZ6uSGiIqEXFVqlIglHIiSS+B4HP3f3i8HXHpkfMi+ylGTDI3ZcUX2kiiU1nV4okvhrA2vDtawppNw24JWLU+h4xrksk4SnkRBLfY8BoM/ua0BUmCvIgoUOZ6WY2PzwtUqrpxBMREQks9eRERCSwFHIiIhJYCjkREQkshZyIiASWQk5ERAJLISciIoGlkBMRkcBSyImISGD9P43TWvojONvaAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 504x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# let's explore the monotonic relationship\n",
    "plt.figure(figsize=(7,5))\n",
    "pd.concat([test_t,y_test], axis=1).groupby(\"fare\")[\"survived\"].mean().plot()\n",
    "plt.title(\"Relationship between fare and target\")\n",
    "plt.xlabel(\"fare\")\n",
    "plt.ylabel(\"Mean of target\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note how the bins are monotonically ordered with the target."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "fengine",
   "language": "python",
   "name": "fengine"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
